// props 传值
import React from 'react';

class Child extends React.Component {
    state = {
      test: '我是子组件传递给父组件的参数'
    };
    handleClick = () => {
      this.props.getMsg(this.state.test);
    };
    render() {
      console.log(this.props);
      return (
        <div>
          <h1>{this.state.test}</h1>
          {this.props.tag}
          <button onClick={this.handleClick}>点击我传递参数给父组件</button>
        </div>
      );
    }
  }
export default Child;